package com.aflac.xml;

import java.io.File;
import java.net.URL;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

public class Main {

	public static void main(String[] args) {
		
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		URL url=classLoader.getResource("girl.xml");
		try {
			//File file = new File("C:\\fileDemo\\girl.xml");
			JAXBContext jaxbC = JAXBContext.newInstance(Root.class);
			Unmarshaller us = jaxbC.createUnmarshaller();
			Root root = (Root) us.unmarshal(url);
			System.out.println(root.toString());
		} catch (JAXBException e) {
			e.printStackTrace();
		}
	}
}
